Can't apply a function because I have NaN